﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using Entities;

namespace Mapping
{
    public class DisciplineMap : ClassMap<Discipline>
    {
        public DisciplineMap()
        {
            Id(x => x.Id)
                .GeneratedBy.Identity();
            Map(x => x.DisciplineTitle)
                .Not.Nullable();
            HasMany(x => x.StudyPlanItems)
                .Cascade.Delete()
                .KeyColumn("DisciplineId")
                .Inverse();
        }
    }
}
